package com.sjgtw.cloud.client.oauth.builder.api;

import com.sjgtw.cloud.client.http.HttpVerb;

public class MaxkeyApi20 extends OAuthApi20 {
    // approval_prompt:force or auto
    private static final String DEFAULT_WEB_URL = "http://sso.maxkey.top/sign";

    private static final String AUTHORIZATION_ENDPOINT = "/authz/oauth/v20/authorize?client_id=%s&response_type=code&redirect_uri=%s&approval_prompt=auto";

    private static final String TOKEN_ENDPOINT    = "/authz/oauth/v20/token?grant_type=authorization_code";
    
    public MaxkeyApi20() {
        this.authorizeUrl = DEFAULT_WEB_URL + AUTHORIZATION_ENDPOINT;
    }

    @Override
    public String getAccessTokenEndpoint() {
        return DEFAULT_WEB_URL + TOKEN_ENDPOINT;
    }

    @Override
    public HttpVerb getAccessTokenVerb() {
        return HttpVerb.POST;
    }
    

    @Override
    public String getGrantType() {
        return "authorization_code";
    }
}
